import { api, dataHandler } from 'utils/http';
// import 'mock/DeploymentMock';

const url = '/api/deployment';

const listDeployment = () => api.get(`${url}/mine`).then(dataHandler);

const createDeployment = (data) => api.post(url, data).then(dataHandler);

// axios delete accepts config instead of data
const deleteDeployment = (data) => api.delete(url, { data }).then(dataHandler);

const publishDeployment = (data) => api.put(url, data).then(dataHandler);

export {
  listDeployment,
  createDeployment,
  deleteDeployment,
  publishDeployment,
};
